﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UIScenenManager
{
	public UIScene uiScene = null;

	private static UIScenenManager _instance;


	public void openSceneUI()
	{
		uiScene = (UIScene)UIManager.getInstance ().openDialog (new UIScene());
	}

	public List<UINode> GetCanGrowUpList(TreePartData treePart)
	{
		var grids = PlayerData.Instance.GetUseableGridForGrowUp(treePart);
		List<UINode> uiNodes = new List<UINode>();
		foreach (var grid in grids) 
		{
			var uiNode = uiScene.getNodeByXY (grid.PosX,grid.PosY);
			uiNodes.Add (uiNode);
		}
		return uiNodes;
	}

	public static UIScenenManager getInstance()
	{
		if (_instance == null)
			_instance = new UIScenenManager ();
		return _instance;
	}
}
